package com.ztzh.temteam;

import com.ztzh.temteam.websocket.CustomWebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication()
public class DemoApplication  implements CommandLineRunner {
    @Autowired
    private CustomWebSocketServer webSocketServer;
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        webSocketServer.start();
        System.out.println("WebSocket server started on port: " + webSocketServer.getPort());
    }
}